package cn.youyeku.sockettransmission.CLIENT;



import android.util.Log;

import java.io.IOException;

import cn.youyeku.sockettransmission.utils.LogUtils;

/**
 * Created by youye on 17-6-10.
 */
public class TextClient extends BaseClientSocket {

    TextClientListener mTextClientListener;
    public TextClient(String IP_ADDRESS, int PORT, String mSocketType) {
        super(PORT, IP_ADDRESS, mSocketType);
    }

    @Override
    protected void onGetRecycle() throws IOException {
        String msg = mInRead.readUTF();
        LogUtils.w("服务器"+msg);
        mTextClientListener.onRecMessage(msg);
    }

    public void sendText(String text) throws IOException {
        LogUtils.w("发送文件到服务器"+text);
        mOutWrite.writeUTF(text);
    }



  public void setTextClientListener(TextClientListener textClientListener){
        mTextClientListener = textClientListener;

  }

    public interface TextClientListener{
        void onRecMessage(String msg);
    }


}
